3.221 \(\int (B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^2(c+d x) \, dx\)

Optimal. Leaf size=16 \[ \frac{B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

[Out]

C*x + (B*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0475166, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.107, Rules used = {3010, 2735, 3770} \[ \frac{B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

Antiderivative was successfully verified.

[In]

Int[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (B*ArcTanh[Sin[c + d*x]])/d

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx &=\int (B+C \cos (c+d x)) \sec (c+d x) \, dx\\ &=C x+B \int \sec (c+d x) \, dx\\ &=C x+\frac{B \tanh ^{-1}(\sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0060913, size = 16, normalized size = 1. \[ \frac{B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

Antiderivative was successfully verified.

[In]

Integrate[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (B*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Maple [A]  time = 0.035, size = 30, normalized size = 1.9 \begin{align*} Cx+{\frac{B\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Cc}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x)

[Out]

C*x+1/d*B*ln(sec(d*x+c)+tan(d*x+c))+1/d*C*c

________________________________________________________________________________________

Maxima [B]  time = 1.32661, size = 50, normalized size = 3.12 \begin{align*} \frac{2 \,{\left (d x + c\right )} C + B{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*C + B*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)))/d

________________________________________________________________________________________

Fricas [B]  time = 1.67482, size = 95, normalized size = 5.94 \begin{align*} \frac{2 \, C d x + B \log \left (\sin \left (d x + c\right ) + 1\right ) - B \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="fricas")

[Out]

1/2*(2*C*d*x + B*log(sin(d*x + c) + 1) - B*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (B + C \cos{\left (c + d x \right )}\right ) \cos{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**2,x)

[Out]

Integral((B + C*cos(c + d*x))*cos(c + d*x)*sec(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.26151, size = 58, normalized size = 3.62 \begin{align*} \frac{{\left (d x + c\right )} C + B \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - B \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="giac")

[Out]

((d*x + c)*C + B*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - B*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d